import common from './common.js'
import filter from './filter.js'

const getProductNo = () => {
    return '13651896445'
}
const getSessionKey = () => {
    return '13651896445'
}

/*
* 校验号码输入的正确性
* return Boolean true-手机号格式正确  false-格式有误
* */
const checkProductNo = (value) => {
    return /^1[3456789]\d{9}$/.test(value);

};
const Context = '@@clickoutsideContext'
export default {
    install(Vue) {
        Vue.$util = Vue.prototype.$util = {
            getProductNo,
            getSessionKey,
            checkProductNo,
            filter,
            common
        }
        Vue.directive("real-img",async function (el, binding) {
            // console.log(el.getAttribute('src'))
            // console.log(el.getAttribute('alt'))
            el.setAttribute('src', 'https://webimg.quanjing.com/Recommend/1570811955169.jpg');
        })
    }
}